package net.zhnb.service.impl;

import java.math.BigDecimal;

import javax.annotation.Resource;

import finaler.util.Page;
import finaler.util.PageList;

import net.zhnb.bean.Lottery;
import net.zhnb.bean.LotteryKey;
import net.zhnb.dao.LotteryDao;
import net.zhnb.service.LotteryService;

public class LotteryServiceImpl implements LotteryService {

	@Resource
	private LotteryDao lotteryDao;

	@Override
	public boolean insert(Lottery lottery) throws Exception {
		return lotteryDao.insert(lottery);
	}
	
	@Override
	public Lottery findByKey(LotteryKey key) throws Exception {
		return lotteryDao.findByKey(key);
	}

	@Override
	public boolean update(Lottery lottery) throws Exception {
		return lotteryDao.update(lottery);
	}

	@Override
	public int getLotteryCount(String mobile) throws Exception {
		return lotteryDao.getLotteryCount(mobile);
	}

	@Override
	public int getLotteryCount(String mobile, int lun) throws Exception {
		return lotteryDao.getLotteryCount(mobile,lun);
	}

	@Override
	public int countByMobileShowerid(String mobile, BigDecimal lun, BigDecimal showerid) throws Exception {
		return lotteryDao.countByMobileShowerid(mobile, lun, showerid);
	}

	@Override
	public int getMaxLotteryId(String mobile) throws Exception {
		return lotteryDao.getMaxLotteryId(mobile);
	}

	@Override
	public PageList getPageList(Page page) throws Exception {
		return lotteryDao.getPageList(page);
	}

	@Override
	public boolean deleteByKey(LotteryKey key) throws Exception {
		return lotteryDao.deleteByKey(key);
	}
	
}
